<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 计算约数个数
        function fun(a) {
            var sum = 0;
            for(var i = 1 ; i <= a ; i++){
                if(a % i == 0){
                    sum++;
                }
            }
            return sum;
        }
        // 判断是否质数
        function zhishu(a) {
            if( fun(a) == 2){
                return true;
            }else{
                return false;
            }
        }
        for (i = 1 ; i < 1000 ; i++){
            if (i % 2 === 0) {
                for (j = 1 ; j < i; j++) {
                    var k = i - j;
                    if(zhishu(j) && zhishu(k)) {
                        console.log(i + "可以分成" + j + "和" + k + "验证了哥德巴赫猜想");
                        break;
                    }
                }
            }
        }
    </script>
</head>
<body>
    
</body>
</html>